﻿using Microsoft.Extensions.Caching.Memory;
using OAS.Application.ReimburseApp.Dtos;
using OAS.Application.RequestApp.Services;
using OAS.Application.System.Dtos;
using OAS.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OAS.Application.RequestApp
{
    public class RequestController : IDynamicApiController
    {
        private readonly ISqlSugarClient db;
        private readonly IRequestService _requestService;
        public RequestController(IRequestService requestService, ISqlSugarClient db)
        {
            this.db = db;
            _requestService = requestService;
        }
        //考勤
        public async Task<List<Request>> GetAllRequest()
        {
            return await _requestService.GetAllRequest();
        }
        [HttpPost]
        public async Task<object> GetRequestList(DtoQuery dto)
        {
            return await _requestService.GetRequestList(dto);
        }
        public async Task AddRequest(Request request)
        {
            await _requestService.AddRequest(request);
        }
        public async Task UpdateRequest(Request request)
        {
            await _requestService.UpdateRequest(request);
        }
        public async Task DeleteRequest([FromBody] string[] ids)
        {
            await _requestService.DeleteRequest(ids);
        }
        public async Task AuditRequest(DtoAudit dto)
        {
            await _requestService.AuditRequest(dto);
        }
    }
}
